package day5.jiekou.fight;

public class ClassDateInterimp1 extends student implements ClassDataInter
{     student students[]=new student[5];
    public ClassDateInterimp1(){}
    public ClassDateInterimp1(student[]students)
    {
        this.students=students;
    }//不用强迫自己，大不了自己搞一个方法来赋值。仔细想一下需不需要有参直接传数组就行



    @Override
    public void printDate()
    {
        for(int i=0;i<students.length;i++)
        {
            System.out.print(students[i].getName()+" ");
            System.out.print(students[i].getSex()+" ");
            System.out.println(students[i].getScore());
        }
    }
    @Override
    public void printAverage()
    {
        double sum=0;
        for(int i=0;i<students.length;i++)
        {
            sum+=students[i].getScore();
        }
        System.out.println("平均成绩是："+sum / students.length);
    }
}
